<%--
  Created by IntelliJ IDEA.
  User: xiong
  Date: 2020/7/12
  Time: 9:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String oidStr = request.getParameter("oid");//用request得到
%>
<html>
<head>
    <title>订单详情</title>
</head>
<link rel="stylesheet" type="text/css" href="layui/css/layui.css">
<script src="layui/layui.js"></script>
<script src="js/jquery-3.5.1.min.js"></script>

<%--拿到之前页面的订单ID--%>

<body>

<table id="demo" lay-filter="test"></table>

</body>
</html>
<script>
    layui.use(['table','layer','laypage','form'], function(){
        var table = layui.table;

        //第一个实例
        table.render({
            elem: '#demo'
            ,height: 312
            ,url: '/order/getDetail?oid='+<%=oidStr%> //数据接口
            ,page: true //开启分页
            ,cols: [[ //表头
                {field: 'fid', title: '食物ID', width:180, sort: true, fixed: 'left'}
                ,{field: 'foodName', title: '食物名', width:180}
                ,{field: 'foodPrice', title: '单价', width:100, sort: true}
                ,{field: 'orderNum', title: '订单数目', width:100}
                ,{field: 'ordertime', title: '订单时间', width: 200}
            ]]
        })


    });
</script>
